#include "Actions/ActionMoveObject.h"

using namespace Ogre;
ActionMoveObject::ActionMoveObject(Ogre::Camera *mCam,Ogre::SceneNode *node, RaySceneQuery* ray){

	if(!mCurrentObject)
		delete mCurrentObject;
	mCurrentObject = new SceneObject(node,mCam,ray);
}

ActionMoveObject::~ActionMoveObject(){}

void ActionMoveObject::updateGraphics(const Ogre::FrameEvent &evt){
	
	mCurrentObject->moveObject();
}

void ActionMoveObject::mouseMoved(const OIS::MouseEvent &arg){

	mCurrentObject->moveObject();
}

void ActionMoveObject::mousePressed(const OIS::MouseEvent &evt){

	mCurrentObject->stopObject();
}

void ActionMoveObject::changeObject(Ogre::SceneNode *node){

	mCurrentObject->changeObject(node);
}